﻿using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using YF_Music.Core;
using YF_Music.Modules.APP_My.ViewModels;
using YF_Music.Modules.APP_My.Views;

namespace YF_Music.Modules.APP_My
{
  public class APP_My_Module : IModule
  {
    private readonly IRegionManager _regionManager;

    public APP_My_Module(IRegionManager regionManager)
    {
      _regionManager = regionManager;
    }

    public void OnInitialized(IContainerProvider containerProvider)
    {
      _regionManager.RequestNavigate(RegionNames.ContentRegion, App_My_ViewNames.APP_MyView);
      var playMusic = containerProvider.Resolve<PlayMusicViewModel>();
      playMusic.ToString();
    }

    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
      containerRegistry.RegisterForNavigation<APP_MyView>();
      containerRegistry.RegisterForNavigation<LocalMusicView>();
      containerRegistry.RegisterForNavigation<PlayMusicView>();
    }
  }
}